Hasty Pudding Cipher
   HOME

TheInfoList



OR:

The Hasty Pudding cipher (HPC) is a variable-block-size block cipher designed by
Richard Schroeppel Richard C. Schroeppel (born 1948) is an American mathematician born in Illinois. His research has included magic squares, elliptic curves, and cryptography. In 1964, Schroeppel won first place in the United States among over 225,000 high school ...
, which was an unsuccessful candidate in the competition for selecting the
U.S. The United States of America (U.S.A. or USA), commonly known as the United States (U.S. or US) or America, is a country primarily located in North America. It consists of 50 states, a federal district, five major unincorporated territori ...
Advanced Encryption Standard The Advanced Encryption Standard (AES), also known by its original name Rijndael (), is a specification for the encryption of electronic data established by the U.S. National Institute of Standards and Technology (NIST) in 2001. AES is a varian ...
(AES). It has a number of unusual properties for a block cipher: its input block size and key length are variable, and it includes an additional input parameter called the "spice" for use as a secondary, non-secret key. The Hasty Pudding cipher was the only AES candidate designed exclusively by U.S. cryptographers. The Hasty Pudding cipher is in the
public domain The public domain (PD) consists of all the creative work to which no exclusive intellectual property rights apply. Those rights may have expired, been forfeited, expressly waived, or may be inapplicable. Because those rights have expired, ...
.


The cipher

The Hasty Pudding cipher consists of 5 different sub-ciphers: The Hasty Pudding cipher algorithms all use 64-bit words internally. The cipher is designed to run on 64-bit
machines A machine is a physical system using power to apply forces and control movement to perform an action. The term is commonly applied to artificial devices, such as those employing engines or motors, but also to natural biological macromolecul ...
, which can easily perform simple operations on 64-bit words.


Key expansion

The Hasty Pudding cipher can take a key of any number of bits for any one of the five subciphers. The cipher itself uses a '' key table'' of 16,384 bits (256 64-bit words). To derive the key table from the key, the key expansion function uses the following algorithm: # The first three words, ''KX'' ''KX'' ''KX'' are set based on constants, the sub-cipher, and the length of the key. ''KX'' is computed with a multiplication; the other operations involved are an addition and a bit shift. # Each successive word, ''KX'' 'i''is determined from the three previous words by an efficient recursive formula. # The key bits are XORed into the bits of the key table, starting at ''KX'' until all the key bits are used. (Keys longer than 8,192 bits use a more complicated procedure.) # Several passes over the key table are made. Each time, a "stirring function" is applied to each word of the key table, in sequence. The stirring function uses eight internal variables, and uses 14 logical bit operations, 5 bit shifts, and 14 additions / subtractions. Each use of the stirring function modifies one word in the key table, based on its previous value, the values of certain other words, and the internal variables of the stirring function. (3 total passes is the default.)


Encryption and decryption

Each of the subciphers uses a different algorithm, but there are certain similarities. Three inputs are used to determine the ciphertext: the plaintext (in several 64-bit words plus one "fragment"), the spice (eight 64-bit words, with default value 0), and the key table. The operations within the cipher consist of ''stirring'', which combines internal variables in various ways with values from the key table and spice at regular intervals. HPC-Short uses two fixed permutations in addition, and HPC-Tiny consists of many special sub-cases. Decryption involves undoing the steps of encryption one by one. Many operations are easily undone (e.g. ''s'' = ''s'' + ''s'' is undone by computing ''s'' = ''s'' − ''s''). Other operations are more complex to undo. Some of the ideas involved include: * An operation like ''x'' = ''x'' ⊕ (''x'' >> 17) is undone by a two-step process: (1) ''x'' = ''x'' ⊕ (''x'' >> 17), followed by (2) ''x'' = ''x'' ⊕ (''x'' >> 34). * The cipher uses value-dependent lookups into the key table. These can be undone, since the lookup depends only on the last 8 bits of a variable, and when it becomes necessary to look up the value from the key table in decryption, the last 8 bits of the value at a certain earlier point in the computation are predictable, even when those operations cannot all be undone without the key table value. For instance, if the lookup of ''k'' is based on the last 8 bits of ''x'', then when we want to undo a step like ''x'' = ''x'' ⊕ (''k'' << 8), we can look up ''k'' by noting that the last 8 bits of ''x'' are unchanged by this operation. The Hasty Pudding cipher can also be used to encrypt values in a range that do not translate to strings with an integral number of bits; for instance, it can encrypt a number from 0 to N by producing another number from 0 to ''N''. It does this by using the smallest subcipher that can handle the input as a bit string, and applying it to the input as a bit string, repeatedly, until the output is in the proper range.


Performance

Schroeppel claimed that the Hasty Pudding cipher was the fastest AES candidate on a 64-bit architecture;Rich Schroeppel,
The Hasty Pudding Cipher: One Year Later
', accessed 9-01-2008
Schroeppel claimed that it was twice as fast as its nearest competitor, DFC, and three times as fast as the other candidates, and that its performance on a 32-bit machine was adequate. Comments from others did not support this view; for instance,
Schneier Schneier is a surname. Notable people with the surname include: * Arthur Schneier (born 1930), Austrian-American rabbi and human rights activist * Bruce Schneier (born 1963), American cryptographer, computer security specialist, and writer * Marc Sc ...
et al.'s analysis ranked the Hasty Pudding cipher 4th best (376 cycles) on a 64-bit machine, although for Rijndael and
Twofish In cryptography, Twofish is a symmetric key block cipher with a block size of 128 bits and key sizes up to 256 bits. It was one of the five finalists of the Advanced Encryption Standard contest, but it was not selected for standardization. T ...
, the performance was only estimated.
Bruce Schneier Bruce Schneier (; born January 15, 1963) is an American cryptographer, computer security professional, privacy specialist, and writer. Schneier is a Lecturer in Public Policy at the Harvard Kennedy School and a Fellow at the Berkman Klein Cente ...
, John Kelsey,
Doug Whiting Doug is a male personal name (or, depending on which definition of "personal name" one uses, part of a personal name). It is sometimes a given name (or "first name"), but more often it is hypocorism (affectionate variation of a personal name) which ...
, David Wagner, Chris Hall, and Niels Ferguson,
Performance Comparison of the AES Submissions
', The Second AES Candidate Conference, 1999.
On a 32-bit
Pentium Pentium is a brand used for a series of x86 architecture-compatible microprocessors produced by Intel. The original Pentium processor from which the brand took its name was first released on March 22, 1993. After that, the Pentium II and P ...
, Hasty Pudding encryption was rated by Schneier et al. at 1600 clock cycles, 10th best out of the 15 candidates. Schneier et al., and Schroeppel, noted that the speed of the cipher would be significantly impacted on a 32-bit machine because of its heavy use of 64-bit operations, particularly bit shifts.Rich Schroeppel and Hilarie Orman,
An Overview of the Hasty Pudding Cipher
'' July 1998.
The Hasty Pudding cipher's key setup was rated as relatively slow; 120000 cycles on a Pentium. The cipher was criticized for its performance on
smartcard A smart card, chip card, or integrated circuit card (ICC or IC card) is a physical electronic authentication device, used to control access to a resource. It is typically a plastic credit card-sized card with an embedded integrated circuit (IC) c ...
s. Specifically, some comments pointed out the difficulty of keeping over 2KB of RAM for the key table.


Further work

There have been relatively few results on attacking the Hasty Pudding cipher. Early in the AES process, David Wagner noted that relatively large classes of Hasty Pudding keys were equivalent in that they led to the same key table.David Wagner, ''Equivalent keys for HPC'', rump session talk at the 2nd AES Conference,
Rome , established_title = Founded , established_date = 753 BC , founder = King Romulus (legendary) , image_map = Map of comune of Rome (metropolitan city of Capital Rome, region Lazio, Italy).svg , map_caption ...
, March 1999.
This was expanded upon by D'Halluin et al., who noted that for 128-bit keys, approximately 2120 keys are ''weak keys'' that each have 230 equivalent keys each. In response to this attack, Schroeppel modified the key expansion algorithm to include one additional step. Despite the relative lack of cryptanalysis, the Hasty Pudding cipher was criticized for its hard-to-understand design and its lack of grounding in research results. Schroeppel has offered a bottle of Dom Pérignon champagne to the best paper presenting progress on the Hasty Pudding cipher. It did not make the second round of consideration for AES. The Hasty Pudding cipher is considered the first tweakable block cipher.Moses Liskov,
Ronald Rivest Ronald Linn Rivest (; born May 6, 1947) is a cryptographer and an Institute Professor at MIT. He is a member of MIT's Department of Electrical Engineering and Computer Science (EECS) and a member of MIT's Computer Science and Artificial Int ...
, and David Wagner, ''Tweakable Block Ciphers'', in Advances in Cryptology — Proceedings of CRYPTO '02, 2002.


References


See also

*
Format-Preserving Encryption In cryptography, format-preserving encryption (FPE), refers to encrypting in such a way that the output (the ciphertext) is in the same format as the input (the plaintext). The meaning of "format" varies. Typically only finite sets of characters ar ...
{{Cryptography navbox , block Block ciphers